/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Munliga
 */
@Entity
@Table(name = "prv_timetable_doctor")
@NamedQueries({
    @NamedQuery(name = "PrvTimetableDoctor.findAll", query = "SELECT p FROM PrvTimetableDoctor p"),
    @NamedQuery(name = "PrvTimetableDoctor.findById", query = "SELECT p FROM PrvTimetableDoctor p WHERE p.id = :id"),
    @NamedQuery(name = "PrvTimetableDoctor.findByDateTimeStart", query = "SELECT p FROM PrvTimetableDoctor p WHERE p.dateTimeStart = :dateTimeStart"),
    @NamedQuery(name = "PrvTimetableDoctor.findByDateTimeStop", query = "SELECT p FROM PrvTimetableDoctor p WHERE p.dateTimeStop = :dateTimeStop")})
public class PrvTimetableDoctor implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    private Long id;
    @Basic(optional = false)
    @Column(name = "DateTimeStart")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateTimeStart;
    @Basic(optional = false)
    @Column(name = "DateTimeStop")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateTimeStop;
    @JoinColumn(name = "m_doctor_ID", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private MDoctor mDoctor;

    public PrvTimetableDoctor() {
    }

    public PrvTimetableDoctor(Long id) {
        this.id = id;
    }

    public PrvTimetableDoctor(Long id, Date dateTimeStart, Date dateTimeStop) {
        this.id = id;
        this.dateTimeStart = dateTimeStart;
        this.dateTimeStop = dateTimeStop;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getDateTimeStart() {
        return dateTimeStart;
    }

    public void setDateTimeStart(Date dateTimeStart) {
        this.dateTimeStart = dateTimeStart;
    }

    public Date getDateTimeStop() {
        return dateTimeStop;
    }

    public void setDateTimeStop(Date dateTimeStop) {
        this.dateTimeStop = dateTimeStop;
    }

    public MDoctor getMDoctor() {
        return mDoctor;
    }

    public void setMDoctor(MDoctor mDoctor) {
        this.mDoctor = mDoctor;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PrvTimetableDoctor)) {
            return false;
        }
        PrvTimetableDoctor other = (PrvTimetableDoctor) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.PrvTimetableDoctor[id=" + id + "]";
    }

}
